17. Exercise: Landscape Layout

Landscape Layout

In this exercise, you will get to implement an alternative layout for the boarding pass app to support landscape mode.

Exercise Code

Exercise: T11.03-Exercise-LandscapeLayout

Landscape Layout

Now it's your turn to create a new layout file for the landscape design and reorder views to make them all fit in the same landscape screen.

SOLUTION:
  • Create new smaller layout files for flight information and boarding information
  • Move the appropriate views out of the main activity layout to those new smaller layouts
  • Point to the smaller layouts from the main layout using the tags
  • Update the binding setters to point to the correct layout
  • Copy activity_main.xml into the layout-land
  • Re-organize the views in the landscape file to fit all in the one screen